package com.jingtai.shop.service.user;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jingtai.core.entity.member.MemberAddress;
import com.jingtai.shop.webfacade.bo.address.SaveAddressBO;
import com.jingtai.shop.webfacade.bo.address.UpdateAddressBO;

/**
 * <p>
 * 用户收货地址表 服务类
 * </p>
 *
 * @author GR123
 * @since 2020-11-29
 */
public interface MemberAddressService extends IService<MemberAddress> {

    /**
     * 查询用户地址分页列表
     */
    Page<MemberAddress> pageMemberAddress(Long userId, Long pageNo, Long pageSize);

    /**
     * 添加用户地址
     */
    boolean saveMemberAddress(SaveAddressBO bo,Long userId);

    /**
     * 设置默认地址
     * @param userId 用户id
     * @param id 地址id
     * @return true/false
     */
    boolean setDefaultAddress(Long userId,Long id);

    /**
     * 删除用户地址
     * @param id 地址主键ID
     * @return
     */
    boolean deleteMemberAddress(Long id);

    /**
     * 根据id查询用户地址
     */
    MemberAddress queryMemberAddress(Long id);

    /**
     * 修改用户地址
     */
    boolean updateMemberAddress(UpdateAddressBO bo);

    /**
     * 根剧用户id查询默认地址
     */
    MemberAddress queryDefaultAddress(Long userId);
}
